<template>
    <div>
        <el-container>
            <el-header>
                <hearDer />
            </el-header>
            <el-container>
                <el-aside>
                    <navContent />
                </el-aside>
                <el-main>
                    <keep-alive>
                        <router-view v-if="$route.meta.keepAlive" v-slot="{ Component }">
                            <component :is="Component"></component>
                        </router-view>
                    </keep-alive>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
<script>
import hearDer from "@/components/hearder.vue"
import navContent from "@/components/navcontent.vue"

export default {
    components: {
        hearDer,
        navContent
    },

    data() {
        return {

        }
    },
    watch: {
        '$route'() {
            if (this.$route.meta.keepAlive) {
                this.$nextTick(() => {
                    this.$forceUpdate();
                });
            }
        }
    },

    created() {


    },
    methods: {

    }
}
</script>
<style lang="scss" scoped>
.el-card__body,
.el-main {
    padding: 0 !important;
}

.el-header {
    padding: 0 !important;
    height: 68px !important;
}

.el-aside {
    width: 230px !important;
}

.el-main {
    // margin-top: 60px !important;
}
</style>